<?php
// 获取病例信息
// header("content-type:text/html;charset=UTF-8");
include_once("conn.php");
if (!isset($_GET['casesid'])) {
    exit();
}

$casesID = $_GET['casesid'];

$select_cases = "SELECT * FROM cases_infos WHERE cases_ID = '" . $casesID . "'";

if ($result_cases = mysqli_query($connect_DB, $select_cases)) {
    if (mysqli_num_rows($result_cases) > 0) {
        $row_cases = mysqli_fetch_object($result_cases);
        echo "
        <button class='closebtn' onclick='removeBox()'>X</button>
            <h5>病 例 信 息</h5>
            <div class='cases-row1'>
                <p><span>病例ID:</span>" . $row_cases->cases_ID . "</p>
            </div>
            <div class='cases-row1'>
                <p><span>宠物昵称:</span>" . $row_cases->cases_petName . "</p>
                <p><span>宠物类别:</span>" . $row_cases->cases_petType . "</p>
                <p><span>服务类型:</span>" . $row_cases->cases_orderType . "</p>
            </div>
            <div class='cases-row1'>
                <p><span>上传医生ID:</span>" . $row_cases->cases_docID . "</p>
                <p><span>上传医生姓名:</span>" . $row_cases->cases_docName . "</p>
                <p><span>上传日期:</span>" . $row_cases->cases_date . "</p>
            </div>
            <div class='cases-row2'>
                <p><span>诊断结果:</span>" . $row_cases->cases_result . "</p>
            </div>
            <div class='cases-row2'>
                <p><span>解决方案:</span>" . $row_cases->cases_deal . "</p>
            </div> ";
    }
    else{
        echo "
        <button class='closebtn' onclick='removeBox()'>X</button>
        <h5>没有该病例信息</h5>";
    }
} else {
    echo "查询失败<br>" . $select_cases;
}

$connect_DB->close();
?>